package com.bandroid.demo.view;

import android.os.Bundle;
import android.widget.ArrayAdapter;

import com.bandroid.demo.R;
import com.base.balibrary.base.BaseMoreListView;
import com.base.balibrary.ioc.BaseContentView;
import com.base.balibrary.ioc.BaseViewInject;
import com.base.balibrary.view.custom.CarouselRelativeLayout;


/**
 * BAndroid
 * Created by YichenZ on 2015/8/4 14:28.
 */
@BaseContentView(R.layout.activity_listview)
public class ListActivity extends BaseMoreListView {

    @BaseViewInject(R.id.carouselRl)
    CarouselRelativeLayout carouseRl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initData();
        initUI();
    }

    private void initData() {
        Object[] url=new String[]{ "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg", "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg", "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg","http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg"};
        carouseRl.show(url);
    }

    private void initUI() {
        initListView(R.id.dataList);
        pullDownView.setHideFooter();
        String[] strs = {
                "The",
                "Canvas",
                "class",
                "holds",
                "the",
                "draw",
                "calls",
                ".",
                "To",
                "draw",
                "something,",
                "you",
                "need",
                "4 basic",
                "components",
                "Bitmap",
        };
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strs);
        listView.setAdapter(adapter);
    }

    @Override
    public void onRefresh() {
        super.onRefresh();
    }

    @Override
    public void onMore() {
        super.onMore();
    }
}
